import { yfuPost } from '@/utils/request'

export function getUserInfoListByOrganizationId (param, then1, error1) {
  yfuPost(process.env.BASE_API, '/organization/getUserInfoListByOrganizationId', param, then1, error1)
}

export let organizationTreeApi = {
  name: '得到所有组织数据',
  url: '/static/organizationTree.json',
  functionName: 'getOrganizationList'
}
export let organizationTreeApi1 = {
  name: '得到所有组织数据',
  baseURL: process.env.BASE_API,
  url: '/organization/organizationTree',
  functionName: 'getOrganizationList1'
}

export let getOrganizationById = {
  name: '根据ID得到对应的组织',
  url: '/static/oneorganization.json',
  functionName: 'getOrganizationById'
}

export let getOrganizationList = {
  name: '得到对应的组织的所有人员',
  url: '/static/organizationUserTable.json',
  functionName: 'getOrganizationList'
}

export let getOrganizationUserListRemote = {
  name: '得到对应的组织的所有人员',
  url: '/organization/getUserInfoListByOrganizationId',
  functionName: 'getUserInfoListByOrganizationId'
}
export let getOrganizationListRemote = {
  name: '得到对应的组织的所有二级组织',
  url: '/organization/getChildrenNode',
  functionName: 'getChildrenNode'
}

export let saveOrganizationRemote = {
  name: '新增组织',
  url: '/organization/addOrganization',
  functionName: 'addOrganization'
}

export let deleteOrganizationRemote = {
  name: '删除组织',
  url: '/organization/batchDeleteOrganization',
  functionName: 'batchDeleteOrganization'
}

export let updateOrganizationRemote = {
  name: '修改组织',
  url: '/organization/updateOrganization',
  functionName: 'updateOrganization'
}
export let moveOrganizationRemote = {
  name: '移动组织',
  url: '/organization/moveOrganation',
  functionName: 'moveOrganation'
}

export let AddUserOrganizationRemote = {
  name: '组织添加用户',
  url: '/organization/addUserToOrganation',
  functionName: 'addUserToOrganation'
}

export let removeUserOrganizationRemote = {
  name: '组织删除用户',
  url: '/organization/removeUserToOrganation',
  functionName: 'removeUserToOrganation'
}

export let changeUserToAdminRemote = {
  name: '修改为组管理员',
  url: '/organization/changeUserToAdmin',
  functionName: 'changeUserToAdmin'
}

export let createUserToAdminRemote = {
  name: '组织创建用户',
  url: '/organization/createUserToOrganation',
  functionName: 'createUserToOrganation'
}
